package com.ic.loan.fragment

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.blankj.utilcode.util.ActivityUtils
import com.gyf.immersionbar.ktx.immersionBar
import com.ic.loan.activity.BankAccountNumberActivity
import com.ic.loan.R
import com.ic.loan.activity.MyInfoActivity
import com.ic.loan.activity.SettingsActivity
import kotlinx.android.synthetic.main.fragment_mine.view.*


class MineFragment : Fragment() {

    override fun onCreate(savedInstanceState: Bundle?) {
        immersionBar {
            statusBarDarkFont(true)
        }
        super.onCreate(savedInstanceState)
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_mine, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        view.llBank.setOnClickListener {
            ActivityUtils.startActivity(BankAccountNumberActivity::class.java)
        }
        view.llSettings.setOnClickListener {
            ActivityUtils.startActivity(SettingsActivity::class.java)
        }
        view.llMyInfo.setOnClickListener{
            ActivityUtils.startActivity(MyInfoActivity::class.java)
        }
    }

    companion object {
        @JvmStatic
        fun newInstance() = MineFragment()
    }
}